﻿using UnityEngine;
using System.Collections;

/// <summary>
/// 子弹类型
/// </summary>
public enum BulletTypeEnum
{
	CollisionDisappear,				//碰撞消失
	Always,							//一直存在
}

/// <summary>
/// Bullet move type enum.
/// </summary>
public enum BulletMoveTypeEnum
{
	Line,							//直线运动
	Slash,							//斜线运动
	Follow,							//追踪运动
}

public class TBullet : TSprite {

	[HideInInspector][SerializeField] int id;								//id
//	[HideInInspector][SerializeField] int attack;							//攻击
	[HideInInspector][SerializeField] float moveSpeed;						//移动速度
	[HideInInspector][SerializeField] BulletTypeEnum bulletType;			//子弹类型
	[HideInInspector][SerializeField] BulletMoveTypeEnum bulletMoveType;	//子弹运动类型
	
	
	public override void OnUpdate ()
	{
//		base.OnUpdate ();
	}
	
	public int Id
	{
		get{return id;}
		set{id = value;}
	}
	
//	public int Attack
//	{
//		get{return attack;}
//		set{attack = value;}
//	}
	
	public float MoveSpeed
	{
		get{return moveSpeed;}
		set{moveSpeed = value;}
	}
	
	public BulletTypeEnum BulletType
	{
		get{return bulletType;}
		set{bulletType = value;}
	}
	
	public BulletMoveTypeEnum BulletMoveType
	{
		get{return bulletMoveType;}
		set{bulletMoveType = value;}
	}
	
	void OnTriggerEnter(Collider other) {
		Debug.LogError(other.gameObject + "  ~~~~~  " + gameObject);
	}

}
